<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
  var pageTracker = _gat._getTracker("<%= Spree::Config[:google_analytics_id] %>");
  pageTracker._initData();
  pageTracker._trackPageview();
  pageTracker._addTrans(
  "<%= order.number %>",		//Order Number
  "",		//Affiliation
  "<%= order.total %>",		//Order total
  "<%= order.tax_amount %>",		//Tax Amount
  "<%= order.ship_amount %>",		//Ship Amount
  "",		//City
  "",		//State
  ""		//Country
  );
  <% order.line_items.each do |line_item| -%>
  pageTracker._addItem("<%= order.number %>", "<%= line_item.variant.sku %>", "<%= line_item.variant.product.name %>", 
    "" /*Product Category*/, "<%= line_item.price %>", "<%= line_item.quantity %>");
  <% end -%>
  pageTracker._trackTrans();
</script>
